<template>
  <el-tabs v-model="activeName" type="card">
    <el-tab-pane label="图片" name="1" lazy>
      <Material :type="1" @change="checked($event, 1)"></Material>
    </el-tab-pane>
    <el-tab-pane label="音频" name="2" lazy>
      <Material :type="2" @change="checked($event, 2)"></Material>
    </el-tab-pane>
    <el-tab-pane label="视频" name="3" lazy>
      <Material :type="3" @change="checked($event, 3)"></Material>
    </el-tab-pane>
  </el-tabs>
</template>

<script>
import Material from './components/material'
export default {
  components: {
    Material
  },
  data() {
    return {
      activeName: '1'
    }
  },
  methods: {
    checked(data, type) {
      this.$emit('autoChecked', {
        id: data.id,
        type: type
      })
    }
  }
}
</script>

<style scoped></style>
